export const utils = {

  openTronBrowser: async (address: string) => {
    window.open('https://trx.tokenview.io/cn/address/' + address)
  },

  downloadFile: async (url: string, saveName: string) => {
    try {
      const response = await fetch(url);
      const blob = await response.blob();
      const blobUrl = window.URL.createObjectURL(blob);
      const link = document.createElement('a');
      link.href = blobUrl;
      link.download = saveName;
      link.click();
      window.URL.revokeObjectURL(blobUrl);
    } catch (error) {
      console.error('文件下载失败：', error);
    }
  }

}